from django.db import models

# Create your models here.
class People(models.Model):
    #name
    first_name = models.CharField(max_length = 20)
    last_name = models.CharField(max_length = 20)
    #sex
    MALE = "m"
    FEMALE = "f"
    SEX_CHOICES = (
        (MALE, "Male"),
        (FEMALE, "Female"),
    )
    sex = models.CharField(max_length = 1, choices = SEX_CHOICES, default = MALE)

    age = models.PositiveSmallIntegerField()
    
    location = models.CharField(max_length = 200)
    home_tel = models.CharField(max_length = 20, null = True, blank = True)
    work_tel = models.CharField(max_length = 20, null = True, blank = True)
    email = models.EmailField(max_length = 254)
    fax = models.CharField(max_length = 20, null = True, blank = True)
    website = models.SlugField(max_length = 50, null = True, blank = True)
    
    def __unicode__(self):
        return self.last_name + ", " + self.first_name

class WorkingExp(models.Model):
    people = models.ForeignKey(People)
    industry = models.CharField(max_length = 40)
    post_title = models.CharField(max_length = 50)
    company = models.CharField(max_length = 100)
    start_date = models.DateField()
    end_date = models.DateField(null = True, blank = True)
    location = models.CharField(max_length = 200)
    details = models.TextField(null = True, blank = True)

#TODO refine this
class Responsibility(models.Model):
    workexp = models.ForeignKey(WorkingExp)
    details = models.CharField(max_length = 100)

#TODO refine this
class WorkRecommendation(models.Model):
    workexp = models.ForeignKey(WorkingExp)
    details = models.CharField(max_length = 100)
    
class Education(models.Model):
    people = models.ForeignKey(People)
    university = models.CharField(max_length = "100")
    major = models.CharField(max_length = 40)
    minor = models.CharField(max_length = 40, blank = True, null = True)
    #TODO multiple degrees
    Degree = models.CharField(max_length = 40)
    start_date = models.DateField()
    end_date = models.DateField(null = True, blank = True)


class EduHonor(models.Model):
    education = models.ForeignKey(Education)
    details = models.CharField(max_length = 100)
    
#TODO refine 
class EduActivity(models.Model):
    education = models.ForeignKey(Education)
    details = models.CharField(max_length = 100)
    
#TODO refine
class EduClub(models.Model):
    education = models.ForeignKey(Education)
    club_name = models.CharField(max_length = 50)
    details = models.CharField(max_length = 100)

#TODO refine
class EduProject(models.Model):
    education = models.ForeignKey(Education)
    start_date = models.DateField()
    end_date = models.DateField(null = True, blank = True)
    name = models.CharField(max_length = 100)
    details = models.TextField()

#TODO refine this
class EduRecommendation(models.Model):
    education = models.ForeignKey(Education)
    details = models.CharField(max_length = 100)

class Skill(models.Model):
    people = models.ForeignKey(People)
    skill_description = models.CharField(max_length = 100)
    #TODO refine and how to link skill to specific task
    endorsement_head_count = models.PositiveIntegerField(default = 0)

#TODO refine
class Interest(models.Model):
    people = models.ForeignKey(People)
    interest_description = models.CharField(max_length = 100)

#TODO refine
class GeneralExp(models.Model):
    people = models.ForeignKey(People)
    details = models.TextField()

#TODO Task, Networking, History
